/// <summary>
/// 支付上下文
/// </summary>
public class PaymentContext
{
  private IPaymentStrategy _strategy;

  public PaymentContext(IPaymentStrategy strategy)
  {
    _strategy = strategy;
  }

  // 允许运行时切换策略
  public void SetStrategy(IPaymentStrategy strategy)
  {
    _strategy = strategy;
  }

  public void ExecutePayment(decimal amount)
  {
    _strategy.Pay(amount);
  }
}